import React from 'react'
import Book from './Book/Book'
import Index from './Index/Index'
import BookDetail from './BookDetail/BookDetail'
import './App.css'
//导入包里面的组件
import { BrowserRouter, Routes, Route } from 'react-router-dom'
export default function App() {
  return (
    <div>
      <BrowserRouter>
        <Routes>
          <Route path='/' element={<Index />} />
          <Route path='/books' element={<Book />} />
          {/* 路由占位符，在路由配置的时候一定要添加:名称，这才叫占位符 */}
          <Route path='/book/:id' element={<BookDetail />} />
          <Route path='/bookOne' element={<BookDetail />} />
        </Routes>
      </BrowserRouter>
    </div>
  )
}
